<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>事件函数传参</title>
</head>
<body>

<div id="app">
  <button @click="say()">打个招呼</button>
  <button @click="speak('hello 说句话')">说句话</button>

  <!--$event是事件对象，是固定的写法-->
  <button @click="speak($event)">传事件对象</button>

  <button @click="location( 123, $event, 'abc' )">事件对象混合传</button>

  <button @click="sendEvent">无参事件对象</button>

</div>

<script src="../lib/vue.js"></script>
<script>
  let vm = new Vue({
    el: '#app',
    data: {
      msg: 'Hello World'
    },
    methods: {
      say() {
        alert('Hello Vue')
      },
      speak(msg) {
        console.log(msg)
      },
      location(s1, s2, e) {
        console.log(s1, s2.target.tagName, e)
      },
      sendEvent(e) {
        console.log(e.target.tagName)
      }
    }
  })
</script>


</body>
</html>